﻿using HandyControl.Controls;
using HandyControl.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Vk.Dbp.WpfWindow.Views;

namespace Vk.Dbp.WpfWindow.ViewModels
{
    public class HeaderViewModel:BindableBase
    {
        private readonly IRegionManager _regionManager;

        private string _userName = "未登录";
        public string UserName
        {
            get { return _userName; }
            set { SetProperty(ref _userName, value); }
        }

        public DelegateCommand<string> NavigateCommand { get; private set; }

        public DelegateCommand NotificationCommand { get; private set;}

        public HeaderViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;

            NavigateCommand = new DelegateCommand<string>(navigate);
           NotificationCommand = new DelegateCommand(appNotification);
        }

        private void navigate(string navigatePath)
        {
            if (navigatePath != null)
                _regionManager.RequestNavigate("ContentRegion", navigatePath);
        }
        private void appNotification() {
            Notification.Show(new AppNotificationView(), ShowAnimation.Fade, true);

        }
    }
}
